In the recent years, the JPEG 2000 standard has become a well known method especially for compressing and encoding high definition images. When encoding an image according to the JPEG 2000 algorithm, original image data are transformed into a number of color components, for example, into Y, Cb, and Cr color components. Two-dimensional discrete wavelet transformation (2D-DWT) is carried out on data of each color component to perform frequency analysis, and this transformation produces wavelet coefficients, each of which is represented by, for example, 16-bit data. The thus obtained wavelet coefficients are divided into sub-bands, which are units of processing. For example, in wavelet transformation at level three, there are sub-bands 3LL, 3HL, 3LH, 3HH, 2HL, 2LH, 2HH, 1HL, 1LH, and 1HH. In each sub-band, the wavelet coefficients are divided into bit-planes. In each sub-band, the wavelet coefficients contained in the bit-planes are scanned from the most significant bit (MSB) to the least significant bit (LSB) through three types of coding passes, and then encoding is performed by arithmetic coding. The three types of coding passes are referred to as “significant propagation pass”, “magnitude refinement pass”, and “cleanup pass”.
Compression of the codes are achieved by successively and uniformly truncating the codes, obtained by scanning through the above three passes, of a coding pass through all code blocks in each sub-band sequentially from the bit-planes of the least significant bits. Here, the term “truncating” means to set a target bit to zero, which indicates invalid data. The coding method of the JPEG 2000 algorithm is described in detail in “Overview of the new international standards (JPEG 2000) for coding of still images”, The Journal of the Institute of Image Information and Television Engineers, pp 164-171, Vol. 54, No. 2, 2000.
In the coding process of JPEG 2000, as described above, image data can be easily compressed to a preset target value by successively truncating the codes of a coding pass corresponding to the bit-planes of the least significant bits in each sub-band. However, depending on the method of truncating, sometimes the quality of the reproduced image, which is the image obtained by decoding the compressed codes, may be greatly degraded.